﻿using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Interfaces.RepositoryModels.ExternalModels.FilterModels;
using Interfaces.RepositoryModels.InternalModels.EconomicInformationModels;
using Interfaces.RepositoryModels.InternalModels.NewsInformationModels;
using Interfaces.RepositoryModels.InternalModels.UserRoleModels;

namespace SQLRepositories
{
    public class DBEconomicInformationServiceContext : DbContext, IDBEconomicInformationServiceContext
    {
        public DBEconomicInformationServiceContext()
            : base("sql2012connection")
        {}
        
        //security
        public DbSet<UserModel> Users { get; set; }
        public DbSet<RoleModel> Roles { get; set; }
        public DbSet<SessionModel> Sessions { get; set; }
        //filters
        public DbSet<CompanyFilterModel> CompanyFilters { get; set; }
        public DbSet<IndustryFilterModel> IndustryFilters { get; set; }
        public DbSet<NewsFilterModel> NewsFilters { get; set; }
        public DbSet<XchangeRateFilterModel> XchangeRateFilters { get; set; }
        public DbSet<QuoteisFilterModel> QuoteisFilters { get; set; }
        public DbSet<SectorsFilterModel> SectorsFilters { get; set; }
        //base economic data
        public DbSet<PairModel> PairModels { get; set; }
        public DbSet<XchangeRateModel> XchangeRates { get; set; }
        public DbSet<SectorModel> Sectors { get; set; }
        public DbSet<IndustryModel> Industries { get; set; }
        public DbSet<CompanyModel> Companies { get; set; }
        public DbSet<QuoteModel> Quoteis { get; set; }
        //news models
        public DbSet<FeedModel> Feeds { get; set; }
        public DbSet<NewsDataItemModel> News { get; set; }
        public DbSet<PersonModel> Persons { get; set; }
        public DbSet<CategoryModel> Categories { get; set; }
        public DbSet<LinkModel> Links { get; set; }
        
        public override int SaveChanges()
        {
          return base.SaveChanges();
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
           base.OnModelCreating(modelBuilder);
        }

    }
}
